<!DOCTYPE html>
<html>
	<head>
		<title>Libman</title>
		<%= stylesheet_link_tag    "style", :media => "all" %>
		<%= stylesheet_link_tag    "bootstrap", :media => "all" %>
		<%= stylesheet_link_tag    "bootstrap-responsive", :media => "all" %>
		<%= javascript_include_tag "application" %>
		<%= csrf_meta_tags %>
	</head>
	<body>
		<div id="wrap">
			<div class="header">
				<div class="header1">
					<div class="navbar">
						<div class="navbar-inner">
							<p>
								<%= link_to "Lib4u", :controller => 'default',:action => 'index' %>
							</p>
							<ul class="nav">
								<% if(controller.controller_name == "default")%>
								<li class="active">
									<%= link_to t('home'), :controller => '/default',:action => 'index' %>
								</li>
								<% else %>
								<li>
									<%= link_to t('home'), :controller => '/default',:action => 'index' %>
								</li>
								<% end %>
								
								
								<% if(controller.controller_name == "about_detail")%>
								<li class="active">
									<%= link_to t('About us'), about_detail_index_path  %>
								</li>
								<% else %>
								<li>
									<%= link_to t('About us'), about_detail_index_path  %>
								</li>
								<% end %>
								
								<% if(controller.controller_name == "contact_detail")%>
								<li class="active">
									<%= link_to t('Contact'), contact_detail_index_path %>
								</li>
								<% else %>
								<li>
									<%= link_to t('Contact'),contact_detail_index_path %>
								</li>
								<% end %>
							</ul>
							
							
							
							<div class ="login">
								<%= image_tag("/assets/user_login_icon.png", :alt => "test image") %>
								<% if session[:user] %>
								<% current_user = session[:user]%>
								<div class="welcome">
									<%= t('Welcome')%> <%= current_user.fullname %> | 
									<% if(current_user.role == ADMIN_ROLE)%>
										<%= link_to t('Manager Page'),  indexbooks_manager_books_path %> |
									<% else %> 
										<%= link_to 'User Profile',  session_profile_path%> |
									<% end%>
									<%= link_to t('Change password'),  session_updatepassword_path %> |
									<%= link_to t('Sign out'), session_logout_path %>
								</div>
								<% else %>
								<%= form_tag session_auth_path do %>
								
								<div class="login-input">
									<%= text_field_tag :login_email,nil,:placeholder => 'email',:title => 'email'%>
								</div>
								
								<div class="login-input">
									<%= password_field_tag  :login_password,nil,:placeholder => t('password'),:title => t('password')%>
								</div>
								
								<div class="btn-login">
									<%= submit_tag t('Sign in'), :class => 'btn'%>
								</div>
								<div class="signup">
									<%= link_to t('Forgot your password'),session_resetpassword_path %>
									<%= link_to t('Registration'),signup_path %>
								</div>
								<% end %>
								<% end %>
							</div>

							<!-- end div login -->
							<div class="language">
								<div class="flag">
									<%= link_to image_tag("/assets/vn.png", :alt => "Vietnamese"), :controller => 'language',:action => 'index',:lang =>'vi',:page =>'user'%>
								</div>
								<div class="flag">
									<%= link_to image_tag("/assets/gb.png", :alt => "English"), :controller => 'language',:action => 'index',:lang =>'en',:page => 'user'%>
								</div>
							</div>

						</div>
					</div>

				</div>
				<!-- end div header 1 -->
			</div>

			<div class = "main">
				<%= yield %>
			</div>
			<div class="footer">
				Copyright © 2012 By Ruby Team . All rights reserved.
			</div>
		</div>
	</body>
</html>